package com.damai.js;

import org.mozilla.javascript.Context;
import org.mozilla.javascript.Scriptable;

public class JsUtil {
	public static Object execute(String content){
		try{
			Context ctx = Context.enter();
			Scriptable scope = ctx.initStandardObjects();
			return ctx.evaluateString(scope, content, null, 0, null);
		}finally{
			Context.exit();
		}
	}

}
